package com.caocaog.market.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.system.base.entity.groups.UpdateGroup;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 市场调研
 *
 * @author chechen
 * @date 2022-01-13
 */
@Data
@NoArgsConstructor
@TableName("mk_mart_research")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "mk_mart_research对象", description = "市场调研")
public class MartResearch extends MartResearchBase implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @NotBlank(message = "更新时，id不能为空", groups = {UpdateGroup.class})
    @ApiModelProperty(value = "ID")
    private String id;

    @Dict(dicCode = "mk_whether")
    @TableLogic
    @ApiModelProperty(value = "是否删除", hidden = true)
    protected Integer delFlag;

    public MartResearch(MartResearchBase martResearchBase) {
        super(martResearchBase);
    }

    public MartResearch(MartResearchHis martResearchHis) {
        super(martResearchHis);
        this.id = martResearchHis.getMartResearchId();
    }

    @Override
    public void clearFields () {
        super.clearFields();
        this.delFlag = null;
    }

}
